inherited dm_empresacontato: Tdm_empresacontato
  inherited sqlConsulta: TSQLQuery
    Params = <
      item
        DataType = ftInteger
        Name = 'empresa'
        ParamType = ptInput
      end>
    SQL.Strings = (
      'select'
      '    e.COD_CONTATO,'
      '    e.LIG_COD_EMPRESA,'
      '    e.DESCRICAO,'
      '    e.OCUPACAO,'
      '    e.EMAIL,'
      '    e.TELEFONE,'
      '    e.DATA_CAD,'
      '    e.DATA_ALTERACAO,'
      '    e.OBS,'
      '    e.fornecedor,'
      '    case'
      '      when e.fornecedor = '#39'True'#39' then '#39'Sim'#39' else '#39'N'#227'o'#39
      '    end as fornecedor_desc,'
      '    a.descricao_multiempresa'
      'from empresa_contato e'
      'left join empresa a on (a.cod_empresa = e.lig_cod_empresa)'
      'where e.lig_cod_empresa = :empresa')
  end
  inherited cdsConsulta: TClientDataSet
    object cdsConsultaCOD_CONTATO: TIntegerField
      Alignment = taCenter
      FieldName = 'COD_CONTATO'
      Required = True
    end
    object cdsConsultaLIG_COD_EMPRESA: TIntegerField
      FieldName = 'LIG_COD_EMPRESA'
      Required = True
    end
    object cdsConsultaDESCRICAO: TStringField
      FieldName = 'DESCRICAO'
      Size = 100
    end
    object cdsConsultaOCUPACAO: TStringField
      FieldName = 'OCUPACAO'
      Size = 100
    end
    object cdsConsultaEMAIL: TStringField
      FieldName = 'EMAIL'
      Size = 100
    end
    object cdsConsultaTELEFONE: TStringField
      Alignment = taCenter
      FieldName = 'TELEFONE'
      Size = 15
    end
    object cdsConsultaDATA_CAD: TDateField
      Alignment = taCenter
      FieldName = 'DATA_CAD'
    end
    object cdsConsultaDATA_ALTERACAO: TDateField
      Alignment = taCenter
      FieldName = 'DATA_ALTERACAO'
    end
    object cdsConsultaOBS: TStringField
      FieldName = 'OBS'
      Size = 10000
    end
    object cdsConsultaDESCRICAO_MULTIEMPRESA: TStringField
      FieldName = 'DESCRICAO_MULTIEMPRESA'
      Size = 50
    end
    object cdsConsultaFORNECEDOR: TStringField
      FieldName = 'FORNECEDOR'
      Size = 5
    end
    object cdsConsultaFORNECEDOR_DESC: TStringField
      FieldName = 'FORNECEDOR_DESC'
      Required = True
      FixedChar = True
      Size = 3
    end
  end
  inherited qryPKChave: TSQLQuery
    SQL.Strings = (
      'SELECT GEN_ID(gen_empresa_contato,1)'
      'FROM RDB$DATABASE')
  end
  inherited cdsRegistro: TClientDataSet
    object cdsRegistroCOD_CONTATO: TIntegerField
      Alignment = taCenter
      FieldName = 'COD_CONTATO'
      Required = True
    end
    object cdsRegistroLIG_COD_EMPRESA: TIntegerField
      Alignment = taCenter
      FieldName = 'LIG_COD_EMPRESA'
      Required = True
    end
    object cdsRegistroDESCRICAO: TStringField
      FieldName = 'DESCRICAO'
      Size = 100
    end
    object cdsRegistroOCUPACAO: TStringField
      FieldName = 'OCUPACAO'
      Size = 100
    end
    object cdsRegistroEMAIL: TStringField
      FieldName = 'EMAIL'
      Size = 100
    end
    object cdsRegistroTELEFONE: TStringField
      Alignment = taCenter
      FieldName = 'TELEFONE'
      Size = 15
    end
    object cdsRegistroDATA_CAD: TDateField
      Alignment = taCenter
      FieldName = 'DATA_CAD'
    end
    object cdsRegistroDATA_ALTERACAO: TDateField
      Alignment = taCenter
      FieldName = 'DATA_ALTERACAO'
    end
    object cdsRegistroOBS: TStringField
      FieldName = 'OBS'
      Size = 10000
    end
    object cdsRegistroFORNECEDOR: TStringField
      FieldName = 'FORNECEDOR'
      Size = 5
    end
  end
  inherited sqlRegistro: TSQLQuery
    Params = <
      item
        DataType = ftInteger
        Name = 'contato'
        ParamType = ptInput
      end>
    SQL.Strings = (
      'select'
      '    e.COD_CONTATO,'
      '    e.LIG_COD_EMPRESA,'
      '    e.DESCRICAO,'
      '    e.OCUPACAO,'
      '    e.EMAIL,'
      '    e.TELEFONE,'
      '    e.DATA_CAD,'
      '    e.DATA_ALTERACAO,'
      '    e.OBS,'
      '    e.fornecedor '
      'from EMPRESA_CONTATO e'
      'where e.cod_contato = :contato')
  end
end
